<template>
  <div class="base-panels">
    <h2 class="title2">施工图审查信息 </h2>
    <table class="show-table">
      <colgroup>
        <col width="136">
        <col width="275">
        <col width="136">
        <col width="275">
      </colgroup>
      <tr>
        <td class="key">单位工程名称</td>
        <td>{{detail?.singleName}}</td>
        <td class="key">审图合格书编号</td>
        <td>{{detail?.examBookNo}}</td>
      </tr>
      <tr>
        <td class="key">发证日期</td>
        <td colspan="3">{{ parseTime(detail?.issueDate)}}</td>
      </tr>

      <tr>
        <td class="key">勘察企业</td>
        <td>
          <router-link target="_blank" :to="{ path: `/company/${detail.surveyUnitId}` }"  class="blue" >
            {{ detail?.surveyUnitName }}</router-link >
        </td>
        <td class="key">统一社会信用代码</td>
        <td>{{detail?.surveyUnitCode}}</td>
      </tr>
      <tr>
        <td class="key">勘察项目负责人</td>
        <td colspan="3">{{detail?.surveyLeader}}</td>
      </tr>

      <tr>
        <td class="key">设计企业</td>
        <td>
          <router-link target="_blank" :to="{ path: `/company/${detail.designUnitId}` }"  class="blue" >
            {{ detail?.designUnitName }}</router-link >
        </td>
        <td class="key">统一社会信用代码</td>
        <td>{{detail?.designUnitCode}}</td>
      </tr>
      <tr>
        <td class="key">设计项目负责人</td>
        <td colspan="3">{{detail?.designLeader}}</td>
      </tr>

      <tr>
        <td class="key">图审机构</td>
        <td>
          <router-link target="_blank" :to="{ path: `/company/${detail.censorsId}` }"  class="blue" >
            {{ detail?.censorsName }}</router-link >
        </td>
        <td class="key">统一社会信用代码</td>
        <td>{{detail?.censorsCode}}</td>
      </tr>

    </table>
  </div>

</template>

<script lang="ts">
interface BaseModel {
  censorsCode?:string ;//	图审机构统一社会信用代码	string
  censorsId?:string ;//	图审机构id	string
  censorsName?:string ;//	图审机构	string
  designLeader?:string ;//	设计项目负责人	string
  designUnitCode?:string ;//	设计企业统一社会信用代码	string
  designUnitId?:string ;//	设计企业id	string
  designUnitName?:string ;//	设计企业	string
  examBookId?:string ;//	id	string
  examBookNo?:string ;//	审图合格书编号	string
  issueDate?:number ;//	发证日期	string(date-time)
  singleName?:string ;//	工程名称	string
  surveyLeader?:string ;//	勘察项目负责人	string
  surveyUnitCode?:string ;//	勘察企业统一社会信用代码	string
  surveyUnitId?:string ;//	勘察企业id	string
  surveyUnitName?:string ;//勘察企业
}

import {defineComponent, inject, onMounted, ref} from 'vue';
import { parseTime } from '/@/utils';
import { getSingleReviewApi } from "/@/api/single";
export default defineComponent({

  setup() {
    const singleId = inject('singleId') as string;
    const detail = ref<BaseModel>({});
    const init = async() => {
      let { data , success } = await getSingleReviewApi({singleId});
      success && data ? detail.value=data : console.log ('接口返回错误或者data值为null')

    }
    onMounted(init);
    return {
      parseTime , detail
    }
  },
})
</script>

<style lang="less" scoped>
.base-panels{
  padding: 0 20px 50px;
}

.title2{
  padding: 20px 0 5px;
}

.show-table{
  width: 100%;
  border: 1px solid #f0f0f0;

  tr{
    td{
      height: 50px;
      padding: 5px 15px;
      vertical-align: center;
      border: 1px solid #EAEAEA;

      &.key{
        background: #F3F3F3;
      }

    }
  }
}

.flex{
  flex-wrap: wrap;

  .map{
    width: 100%;
    height: 350px;
  }

  p{
    width: 100%;
    margin: 5px 0 0 0;
    color: #000;
  }
}

.noData{
  background: #fcfcfc url('/src/assets/img/nodata.png') no-repeat center;
  border: 1px solid #EAEAEA;
}
</style>
